<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="org.springside.modules.security.springsecurity.SpringSecurityUtils" %>
<%@ include file="/common/taglibs.jsp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Web 资源管理</title>
	<%@ include file="/common/meta.jsp" %>
	<link href="${ctx}/css/style.css" type="text/css" rel="stylesheet"/>
	<script src="${ctx}/js/jquery.js" type="text/javascript"></script>
	<script src="${ctx}/js/table.js" type="text/javascript"></script>
</head>

<body style="margin-top:20px;">

<div id="content">
	<div id="message"><s:actionmessage theme="mytheme"/></div>
	<form id="mainForm" action="resource.action" method="post">
	<input type="hidden" name="page.pageNo" id="pageNo" value="${page.pageNo}"/>
		<input type="hidden" name="page.orderBy" id="orderBy" value="${page.orderBy}"/>
		<input type="hidden" name="page.order" id="order" value="${page.order}"/>
		<input type="hidden" name="id"  id="id" value=""/>
	
	<div id="filter">
	<h1><img src="${ctx}/skin/images/frame/icon22.gif" align="absbottom"/>&nbsp;资源管理列表</h1><br>
		<div class="ct_bg">
			权限: <input type="text" name="filter_LIKES_value" value="${param['filter_LIKES_value']}" size="9"/> 
			名称: <input type="text" name="filter_LIKES_showname" value="${param['filter_LIKES_showname']}" size="9"/>
			Url: <input type="text" name="filter_LIKES_urlvalue" value="${param['filter_LIKES_urlvalue']}" size="9"/>
				<input class="button" type="button" value="搜索" onclick="search();"/>
		</div>
	</div>

	<div style="margin-top:10px;">
		<table width="95%" border="0" cellpadding="5" cellspacing="0" id="contentTable">
			<tr>
				<th bgcolor="#F5F5F5" background="${ctx}/skin/images/frame/wbg.gif"><a href="javascript:sort('id','asc')">序号</a></th>
				<th bgcolor="#F5F5F5" background="${ctx}/skin/images/frame/wbg.gif"><a href="javascript:sort('upmenu','asc')">父序号</a></th>
				<th bgcolor="#F5F5F5" background="${ctx}/skin/images/frame/wbg.gif"><a href="javascript:sort('showname','asc')">名称</a></th>
				<th bgcolor="#F5F5F5" background="${ctx}/skin/images/frame/wbg.gif"><a href="javascript:sort('value','asc')">权限</a></th>
				<th bgcolor="#F5F5F5" background="${ctx}/skin/images/frame/wbg.gif"><a href="javascript:sort('type','asc')">类型</a></th>
				<th bgcolor="#F5F5F5" background="${ctx}/skin/images/frame/wbg.gif"><a href="javascript:sort('urlvalue','asc')">Url</a></th>
				<th bgcolor="#F5F5F5" background="${ctx}/skin/images/frame/wbg.gif"><a href="javascript:sort('menulevel','asc')">层次</a></th>
				<th bgcolor="#F5F5F5" background="${ctx}/skin/images/frame/wbg.gif"><a href="javascript:sort('menuorder','asc')">排序</a></th>
				<th bgcolor="#F5F5F5" background="${ctx}/skin/images/frame/wbg.gif">授权</th>
				<th bgcolor="#F5F5F5" background="${ctx}/skin/images/frame/wbg.gif">操作</th>
			</tr>

			<s:iterator value="page.result">
				<tr onmousemove="javascript:this.bgColor='#d6eff8';" onmouseout="javascript:this.bgColor='#ffffff';">
					<td align="center">${id}</td>
					<td align="center">${upmenu}</td>
					<td >${showname}</td>
					<td >${value}</td>
					<td align="center">${type}</td>
					<td >${urlvalue}</td>
					<td align="center">${menulevel}</td>
					<td align="center">${menuorder}</td>
					<td align="center">${authNames}</td>
					<td align="center">&nbsp;
						<security:authorize ifAnyGranted="A_VIEW_ROLE">
							<security:authorize ifNotGranted="A_MODIFY_ROLE">
								<a href="resource!input.action?id=${id}">查看</a>&nbsp;
							</security:authorize>
						</security:authorize>

						<security:authorize ifAnyGranted="A_MODIFY_ROLE">
							<a href="javascript:editPage('resource!input.action',${id})">修改</a>&nbsp;
							<a href="javascript:delPage('resource!delete.action',${id})">删除</a> 
						</security:authorize>
				  </td>
				</tr>
			</s:iterator>
	  </table>
	</div>
	<div class="page">
		第${page.pageNo}页, 共${page.totalPages}页
		<a href="javascript:jumpPage(1)">首页</a>
		<s:if test="page.hasPre"><a href="javascript:jumpPage(${page.prePage})">上一页</a></s:if>
		<s:if test="page.hasNext"><a href="javascript:jumpPage(${page.nextPage})">下一页</a></s:if>
		<a href="javascript:jumpPage(${page.totalPages})">末页</a>

		<security:authorize ifAnyGranted="A_MODIFY_ROLE">
		<a href="resource!input.action">增加新资源</a>
		</security:authorize>
	</div>
	</form>
	
</div>

</body>
</html>